<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-04 16:53:56
 * @LastEditTime: 2023-07-11 10:15:28
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 
 */

namespace App\Http\Services\BaseData;

use App\Repositories\MaterialRepository;
use App\Repositories\MpcLotRepository;
use App\Repositories\MaterialCategoryRepository;
use App\Http\Services\Service;
use Illuminate\Support\Facades\DB;

/**
 * @property MpcLotRepository $repository
 */
class LotService extends Service
    {
    public function boot(MpcLotRepository $repository)
        {

        $this->repository = $repository;
        }

    public function list()
        {
        // DB::enableQueryLog();
        $data = $this->repository->condition(request())->getGrid();
        // dd(DB::getQueryLog());
        return $data;
        }

    protected function delete()
        {
        return $this->repository->delete($this->getRequestIds());
        }

    protected function save()
        {
        return $this->repository->autosave(request());
        }

    }